from typing import Any

import scrapy

from pathlib import Path

from scrapy.http import Response


class QuotesSpider(scrapy.Spider):
    name = "quotes"
    # allowed_domains = ["quotes.toscrape.com"]
    # start_urls = [
    #     "https://quotes.toscrape.com/page/1",
    #     # "https://quotes.toscrape.com/page/2",
    # ]

    # def parse(self, response):
    #     page = response.url.split("/")[-2]
    #     filename = f"quotes-{page}.html"
    #     Path(filename).write_bytes(response.body)
    # ress = response.css("title::text").get()
    # herf = response.css("div.col-md-8 h1 a").attrib["href"]
    # print(ress, herf)
    # response.css("a[href*=image] img::attr(src)").getall()
    def parse(self, response):
        yield scrapy.Request(f"https://qu")
